package com.jiang.service;

import com.jiang.mapper.UserMapper;
import com.jiang.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author jiangjingbo
 * @version V1.0
 * @Project java2203
 * @Package com.jiang.service
 * @Description:
 * @Date 2022/6/7 10:43
 */
@Service("service1")
public class Userserviceimpl1  implements Userservice{
    @Autowired
    private UserMapper userMapper;


    public List<User> findUserALL() {
        System.out.println("执行了====findUserALL=====");
        List<User> all = userMapper.findAll();

        return all;
    }

    @Transactional
    public void UpdateUser(User user){
        userMapper.update(user);
//        int i=1/0;
    }
}
